import React, { Component } from 'react';
import { message } from 'antd';
import { router } from 'umi';
import ProDetail from '@/pages/components/Problem/ProblemPage/ProDetail';

class Proble extends Component {
  onModifyData = data => {
    if (data.taskSource === 2 || data.taskSource === 3 || data.taskSource === 4) {
      router.push(
        `/customservicemanage/reduceemployee/update?sendId=${data.sendId}&deduTaskId=${
          data.busiId
        }&taskSource=${data.taskSource}`
      );
    } else if (data.taskSource === 7) {
      router.push(`/customservicemanage/reduceemployee/redassupdate?deduTaskId=${data.busiId}`);
    } else {
      message.warning('努力开发中。。。');
    }
  };

  onViewDetails = data => {
    router.push(
      `/customservicemanage/reduceemployee/detail?deduTaskId=${data.busiId}&taskSource=${
        data.taskSource
      }`
    );
  };

  render() {
    return <ProDetail onModifyData={this.onModifyData} onViewDetails={this.onViewDetails} />;
  }
}

export default Proble;
